<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="./libs/swiper/swiper-bundle.min.css">
  <link rel="stylesheet" href="./css/index.css">
  <title>首页</title>
  <script src="./libs/requirejs/require.min.js" data-main="./js/index"></script>
</head>

<body>
  <!-- 轮播图 -->
  <div class="swiper-container">
    <div class="swiper-wrapper">
      <div class="swiper-slide">
        <img src="./images/banner-1.jpeg" alt="">
      </div>
      <div class="swiper-slide">
        <img src="./images/banner-2.jpeg" alt="">
      </div>
      <div class="swiper-slide">
        <img src="./images/banner-3.jpeg" alt="">
      </div>
    </div>
    <!-- 如果需要分页器 -->
    <div class="swiper-pagination"></div>

    <!-- 如果需要导航按钮 -->
    <div class="swiper-button-prev"></div>
    <div class="swiper-button-next"></div>
  </div>

  <!-- 渲染推荐商品的数据 -->
  <ul class="hot"></ul>

  <!-- 定义渲染推荐商品项的模板 -->
  <script type="text/html" id="hot-template">
    {{each products prod}}
    <li class="hot-item" data-id="{{prod.id}}">
      <div><img class="image" src="{{prod.image}}" alt=""></div>
      <div class="title">{{prod.title}}</div>
      <div>
        <span class="price">{{prod.price}}</span>
        <span>{{prod.saleNum}}</span>
        <button class="add-to-cart">加入购物车</button>
      </div>
    </li>
    {{/each}}
  </script>

  <!-- 侧边购物车 -->
  <div class="side-bar">
    <div class="cart">购物车</div>
  </div>
</body>

</html>